//
//  HPSwiperService.h
//  HPZZTong
//
//  Created by wenjun on 14-5-6.
//  Copyright (c) 2014年 Handpay. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HPBaseSwiper.h"
#import "POSProcess.h"

#define SwiperService               [HPSwiperService sharedInstance]
#define SWIPERENG                   [HPSwiperService sharedInstance]

/**
 刷卡器CSN激活状态
 **/
typedef enum {
    CSNStatusUnknow = -1,
    CSNStatusNone = 0,              // 原始
    CSNStatusAvailable,             // 可用
    CSNStatusUnbound,               // 未绑定
    CSNStatusBoundOtherUser,        // 绑定到其他渠道
    CSNStatusBoundOtherChannel,     // 绑定到其他用户
    CSNStatusLoss,                  // 挂失
    CSNStatusLogOut,                // 注销
}CSNStatus;

typedef enum{
    SwiperTypeNone,
     SwiperTypeBBPOS,                //智嘉刷卡器（支持ic）
    SwiperTypeZhijia,               //智嘉刷卡器（不支持ic）
}SwiperType;

@interface HPSwiperService : NSObject

@property (readonly,nonatomic) CSNStatus csnStatus;

@property (readonly,strong,nonatomic) NSString * csn;

@property (weak,readonly,nonatomic) POSProcess * currentProcess;

+ (HPSwiperService *)sharedInstance;

- (void)selectSwiperAndGetCsn:(SwiperComplete)block isShow:(BOOL)show;

- (void)checkAndConnectSwiper:(SwiperComplete)complete;

- (void)doSwiper:(SwiperComplete)complete;

- (void)doEncyptPin:(NSString *)pin complete:(SwiperComplete)complete;

- (void)doInputICPin:(NSString *)pin complete:(SwiperComplete)complete;

- (void)doInputPwdWithAmount:(NSString *)amount complete:(SwiperComplete)complete;

- (void)doMac:(NSString*)data complete:(SwiperComplete)complete;

- (NSString *)resetFactor;

- (NSString*)getFatorTime;

- (void)setCsnStatus:(CSNStatus)csnStatus;

- (BOOL)cancelSwiperOperation;

- (void)startProcess:(POSProcess *)process;

- (NSString *)icQuestInputPin;

- (void)changeSwiperType:(SwiperType)swiperType;

- (void)doSelectApp:(NSArray*)type complete:(SwiperComplete)complete;


@end
